﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wowhead.Common
{
    public static class Extensions
    {
        public static string ToValueString(this Race race)
        {
            string res = "";

            switch (race)
            { 
                case Race.BloodElf:
                case Race.Draenei:
                case Race.Dwarf:
                case Race.Gnome:
                case Race.Human:
                case Race.NightElf:
                case Race.Orc:
                case Race.Tauren:
                case Race.Troll:
                    res = race.ToString().ToLower();
                    break;
                case Race.Undead:
                    res = "scourge";
                    break;
            }

            return res;
        }

        public static string ToValueString(this Gender gender) 
        {
            return gender.ToString().ToLower();
        }

        public static string ToValueString(this Region region)
        {
            string res = "";

            switch (region)
            { 
                case Region.China:
                    res = "cn";
                    break;
                case Region.Europe:
                    res = "eu";
                    break;
                case Region.Korea:
                    res = "kr";
                    break;
                case Region.Taiwan:
                    res = "tw";
                    break;
                case Region.USA:
                    res = "us";
                    break;
            }

            return res;
        }

        public static string ToValueString(this WowheadObjectType type)
        {
            return type.ToString().ToLower();
        }
    }
}
